package reflect;

/**
 * 使用当前类测试反射机制
 */
@AutoRunClass
public class Person {
    private String name = "张三";
    private int age = 16;

    @MethodAnno
    public void sayHello(){
        System.out.println("Person:hello!");
    }
    @AutoRun
    public void sayHi(){
        System.out.println("Person:Hi!");
    }
    public void say(String info){
        System.out.println("Person:"+info);
    }
    public void say(String info,int sum){
        for(int i=0;i<sum;i++){
            System.out.println("Person:"+info);
        }
    }
    private void hehe(){
        System.out.println("Person:我是私有方法！！");
    }

    public Person(){}

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
